<html>
<head><meta charset="utf-8"><title>GlobalCtxt::enter_local a nop? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/GlobalCtxt.3A.3Aenter_local.20a.20nop.3F.html">GlobalCtxt::enter_local a nop?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="202228379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/GlobalCtxt%3A%3Aenter_local%20a%20nop%3F/near/202228379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/GlobalCtxt.3A.3Aenter_local.20a.20nop.3F.html#202228379">(Jun 28 2020 at 09:29)</a>:</h4>
<p>Does <code>GlobalCtxt::enter_local</code> do anything anymore? It sets a new <code>ImplicitCtxt</code>while only "changing" <code>tcx</code>  in TLS when an existing already exists. <code>TyCtxt</code> only has a single field (<code>gcx</code>) and <code>with_related_context</code> checks that the passed <code>tcx.gcx</code> matches the <code>tcx.gcx</code> of the TLS <code>ImplicitCtxt</code>. Also the documentation of the relevant methods are outdated, as they still talk about an arena being passed in.</p>
<p><a href="https://github.com/rust-lang/rust/blob/0c04344d86f9598f20d9ec86fe87ea2a5d6ff8e6/src/librustc_middle/ty/context.rs#L1560-L1575">https://github.com/rust-lang/rust/blob/0c04344d86f9598f20d9ec86fe87ea2a5d6ff8e6/src/librustc_middle/ty/context.rs#L1560-L1575</a><br>
<a href="https://github.com/rust-lang/rust/blob/0c04344d86f9598f20d9ec86fe87ea2a5d6ff8e6/src/librustc_middle/ty/context.rs#L1825">https://github.com/rust-lang/rust/blob/0c04344d86f9598f20d9ec86fe87ea2a5d6ff8e6/src/librustc_middle/ty/context.rs#L1825</a></p>



<a name="202228462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/GlobalCtxt%3A%3Aenter_local%20a%20nop%3F/near/202228462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/GlobalCtxt.3A.3Aenter_local.20a.20nop.3F.html#202228462">(Jun 28 2020 at 09:31)</a>:</h4>
<p>It's a nop</p>



<a name="202228505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/GlobalCtxt%3A%3Aenter_local%20a%20nop%3F/near/202228505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/GlobalCtxt.3A.3Aenter_local.20a.20nop.3F.html#202228505">(Jun 28 2020 at 09:32)</a>:</h4>
<p>I will remove it then.</p>



<a name="202228935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/GlobalCtxt%3A%3Aenter_local%20a%20nop%3F/near/202228935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/GlobalCtxt.3A.3Aenter_local.20a.20nop.3F.html#202228935">(Jun 28 2020 at 09:47)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/73833">#73833</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>